from PIL import Image

width, height = Image.size
#选取长和宽中较大值作为新图片的·
new_image_length = width if width > height else height
#生成新图片[白底]
new_image = Image.new(Image.mode, (new_image_length, new_image_length), color='white')

def cut_image(image):
    width, height = image.size
    item_width = int(width / 3)
    box_list = []
    # (left, upper, right, lower)
    for i in range(0,3):#两重循环，生成9张图片基于原图的位置
        for j in range(0,3):
            box = (j*item_width,i*item_width,(j+1)*item_width,(i+1)*item_width)
            box_list.append(box)

def save_images(image_list):
    index = 1
    for image in image_list:
        image.save('./beautiful/girls' + str(index) + '.jpg', 'PNG')